  var phonecatApp=angular.module("phonecatApp");
  function PhoneListController($scope,$http) {
      $scope.phones = [
        {
          name: 'Nexus S',
          snippet: 'Fast just got faster with Nexus S.',
          age:3
        }, {
          name: 'Motorola XOOM™ with Wi-Fi',
          snippet: 'The Next, Next Generation tablet.',
          age:1
        }, {
          name: 'MOTOROLA XOOM™',
          snippet: 'The Next, Next Generation tablet.',
          age:2
        }
      ];

      $scope.orderProperty="age";
       $scope.data = {
        availableOptions: [
        {id: '1', name: 'Option A'},
        {id: '2', name: 'Option B'},
        {id: '3', name: 'Option C'}
        ],
      selectedOption: {id: '3', name: 'Option C'} //This sets the default value of the select in the ui
       };

       $scope.getPhones=function(){
          $http.get("/js/components/phone-list/phone.json").then(function(response){
            $scope.phones=response.data;
          });
       }
    }
  phonecatApp.component("phoneList1",{
    templateUrl:"/js/components/phone-list/phone-list1.template.html",
    controller: ["$scope","$http",PhoneListController]
  });
